#include <stdio.h>

int main(int argc, char *argv[]) {

    int n;
    scanf("%d", &n);

    int nums[n][n];
    int k = 1, kf = 0;
    //先给第一列赋值
    for (size_t i = 0; i < n; i++)
    {
        k += kf;
        nums[i][0] = k;
        kf++;
    }

    int nf = n, kz = 0;
    k = kz = 2;
    for (size_t i = 0; i < n; i++)
    {
        kz = k;
        for (size_t z = 1; z < nf; z++)
        {
            nums[i][z] = nums[i][z - 1] + kz++;
        }
        nf--;
        k++;
    }

    nf = n;
    for (size_t i = 0; i < n; i++)
    {
        for (size_t z = 0; z < nf; z++)
        {
            printf("%d ", nums[i][z]);
        }
        nf--;
        printf("\n");
    }
    


    
    
    

    return 0;
}